package com.apes.fn.pi.basicInfo;

import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.Model;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import com.apes.scm.masterdata.frame.model.Dept;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;

/**
 * Created by lishikun on 2022/1/17 16:52
 */
@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = CaamDeptAccount.CONST_TABLE_NAME)
public class CaamDeptAccount extends Model {
    public static final String CONST_TABLE_NAME = "api_caam_dept_account";

    @Id
    @Column(name = "id", nullable = false, length = 4)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "门店维修接口账号")
    private String id;

    @Comment("门店")
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "dept_id", referencedColumnName = "id")
    private Dept dept;

    @Comment("汽车维修接口账号")
    @Column(name = "caam_api_number")
    private String caamApiNumber;

    @Comment("汽车维修接口密码")
    @Column(name = "caam_api_password")
    private String caamApiPassword;

    @Comment("汽车维修电子健康档案接口账号")
    @Column(name = "caamhr_api_number")
    private String caamhrApiNumber;

    @Comment("汽车维修电子健康档案接口密码")
    @Column(name = "caamhr_api_password")
    private String caamhrApiPassword;
}
